import pymysql

conn = pymysql.connect(host='192.168.75.148', port=3306, user='root', passwd='123456', db='zouyao_test')
cs1 = conn.cursor()
sql1 = 'select * from qxb limit 0,5;'
cs1.execute(sql1)
pnlist = []
alldata = cs1.fetchall()
for singl_company in alldata:
    pnlist.append(singl_company[0])
    print(singl_company[0])

cs1.close()
conn.close()

